<?php
/************************************************************
**	Description:
**		Calculates ampacity based on the input parameters and
**		returns a single apacity value as json array
**	
**	Name: Sohel
**	 
************************************************************/

//inputData is a json array
if ( isset($_POST['inputData']) ) {
	$inputDataJSON = $_POST['inputData'];
}
else {
	//for testing puposes
	$inputDataJSON = '{"t":400,"wspd":1500,"wdir":90,"lon":51,"elev":135}';
}

// decode JSON to an object
$inputData = json_decode($inputDataJSON);

$temper = $inputData->{"t"};
$wspd = $inputData->{"wspd"};
$wdir = $inputData->{"wdir"};
//etc....

//////////////////////////////////////////////
//FOR TESTING ONLY
$maxAmp = 300;
$minAmp = 1200;
$amp = rand($maxAmp, $minAmp);
//////////////////////////////////////////////

$outputDataJSON = array("amp" => $amp);

echo json_encode($outputDataJSON);

?>